package com.atguigu.gmall.user.service.impl;

import com.atguigu.gmall.model.user.UserAddress;
import com.atguigu.gmall.user.mapper.UserAddressMapper;
import com.atguigu.gmall.user.service.UserAddressService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-19 15:50
 */
@Service
@RequiredArgsConstructor
public class UserAddressServiceImpl implements UserAddressService {

	private final UserAddressMapper userAddressMapper;

	/**
	 * 跟据用户id查询收货列表
	 */
	@Override
	public List<UserAddress> findUserAddressListByUserId(Long userId) {
		return userAddressMapper.selectList(Wrappers.<UserAddress>lambdaQuery().eq(UserAddress::getUserId, userId));
	}

}
